package com.xc.ezplan.admin.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.xc.ezplan.admin.entity.AdminDept;
import com.xc.ezplan.admin.entity.AdminMenu;
import com.xc.ezplan.admin.entity.AdminUser;
import com.xc.ezplan.core.base.BaseVo;
import com.xc.ezplan.core.enums.DataScopeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;
import java.util.Set;

/**
 * @author lixingchen
 * @date 2022/11/19
 * @description 后台角色VO
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class AdminRoleVo extends BaseVo {

	@ApiModelProperty(value = "角色ID", hidden = true)
	private Long id;

	@JSONField(serialize = false)
	@ApiModelProperty(value = "用户", hidden = true)
	private Set<AdminUser> users;

	@ApiModelProperty(value = "菜单", hidden = true)
	private Set<AdminMenu> menus;

	@ApiModelProperty(value = "部门", hidden = true)
	private Set<AdminDept> depts;

	@NotBlank
	@ApiModelProperty(value = "名称")
	private String name;

	@ApiModelProperty(value = "身份标识")
	private String identity;

	@ApiModelProperty(value = "数据权限，全部 、 本级 、 自定义")
	private String dataScope = DataScopeEnum.THIS_LEVEL.getValue();

	@ApiModelProperty(value = "级别，数值越小，级别越大")
	private Integer level = 3;

	@ApiModelProperty(value = "描述")
	private String description;

	@ApiModelProperty(value = "创建日期")
	private LocalDateTime createTime;

	@ApiModelProperty(value = "等级列表")
	private List<Integer> levelList = Arrays.asList(1, 2, 3);
}
